<?php

header( "Access-Control-Allow-Origin:*" );


$OP = $_POST['OP'];
$CMD = array(
	'OP' => $OP
);

if($CMD['OP'] != null){
	$cmd = "irsend SEND_ONCE AIR ".$CMD['OP'];
	system($cmd);
	if($CMD['OP'] == 'KEY_EXIT')
		$cmd2 = "/home/pi/modules/ITemp.sh AIR_STATUS 0";
	else
		$cmd2 = "/home/pi/modules/ITemp.sh AIR_STATUS 1";
	system($cmd2);
	echo $cmd;
}else{
	echo "error";
}

?>
